<script type="text/javascript">
	function data_list($scope) {
		loadNotify(0);

		$scope['loadNotify'] = function(page) {
			loadNotify(page)
		}

		$scope.$watch('page',function(){
			setTimeout(function(){
				$('tr').popover({animation:true,trigger:'hover'});
			},1000);
		})
		function loadNotify(page) {
			$.getJSON('/notify/page/' + page + '.do', {
				'requestCode' : ''
			}, function(data) {
				$scope.$apply(function() {
					$scope['page'] = data;
				});
			});
		}
		
	}
</script>
<div id="data_list" style="width: 100%" ng-controller="data_list">
	<table class="table table-condensed">
		<thead>
			<tr>
				<th>id</th>
				<th>requestCode</th>
				<th>timestamp</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="notify in page.content" data-content="{{notify.content}}" data-placement="bottom" data-toggle="popover" data-container="body">
				<td>{{notify.id}}</td>
				<td>{{notify.requestCode}}</td>
				<td>{{notify.timestamp | date:'yyyy-MM-dd HH:mm:ss'}}</td>
			</tr>
		</tbody>
	</table>


	<ul class="pagination">
		<li ng-if="page.number-2>=0"><a
			ng_click="loadNotify(page.number-2)">{{page.number-2}}</a></li>
		<li ng-if="page.number-1>=0"><a
			ng_click="loadNotify(page.number-1)">{{page.number-1}}</a></li>
		<li class="active"><a>{{page.number}}</a></li>
		<li ng-if="page.number+1<page.totalPages"><a
			ng_click="loadNotify(page.number+1)">{{page.number+1}}</a></li>
		<li ng-if="page.number+2<page.totalPages"><a
			ng_click="loadNotify(page.number+2)">{{page.number+2}}</a></li>
	</ul>
	
</div>
<script type="text/javascript">
$('tr').popover({animation:true,trigger:'hover'});
</script>